import 'package:flutter/material.dart';
import 'package:x3_base_package/x3_base_package.dart';

class BusinessCustomerDetailsServiceXykDetails extends StatefulWidget {

  static final String sName = 'BusinessCustomerDetailsServiceXykDetails';

  @override
  _BusinessCustomerDetailsServiceXykDetailsState createState() => _BusinessCustomerDetailsServiceXykDetailsState();

}

class _BusinessCustomerDetailsServiceXykDetailsState extends State<BusinessCustomerDetailsServiceXykDetails> {

  @override
  Widget build(BuildContext context) {
    dynamic arguments = BaseRouterUtil.getArguments(context);
    String cardId = BaseUtils.getKeyData(arguments, 'cardId').toString();
    return BaseScaffoldComponent(
      backGroundColor: Colors.white,
      title: '心意卡详情',
      child: BaseScreenRefreshComponent(
        request: BaseScreenRequestModel('/vip/wishcard/query/{id}', method: BaseHttpMethodEnum.GET, params: {'id': cardId}),
        controller: BaseFutureController(),
        builder: _buildXykWidget,
      ),
    );
  }

  Widget _buildXykWidget(BaseHttpResultModel result) {
    return SingleChildScrollView(
      padding: const EdgeInsets.all(12.0),
      child: _buildAnnouncementContentWidget(result),
    );
  }

  Widget _buildAnnouncementContentWidget(BaseHttpResultModel result) {
    String facadeImage = BaseUtils.getKeyData(result.data, 'facadeImage').toString();
    return BaseCardComponent(
      child: BaseImageComponent( imageUrl: facadeImage, width: double.infinity ),
    );
  }

}
